<?php

require_once 'Zend/Acl.php';
require_once 'Zend/Acl/Role.php';
require_once 'Zend/Acl/Resource.php';

class MyAcl extends Zend_Acl {

    public function __construct(Zend_Auth $authClass) {
        $this->addRole(new Zend_Acl_Role('visitante'));
        $this->addRole(new Zend_Acl_Role('cliente'));
        $this->addRole(new Zend_Acl_Role('administrador'));

        $this->add(new Zend_Acl_Resource('default'));

        $this->add(new Zend_Acl_Resource('default:projeto', 'default'));
        $this->add(new Zend_Acl_Resource('default:preferencias', 'default'));
        $this->add(new Zend_Acl_Resource('default:money', 'default'));
        $this->add(new Zend_Acl_Resource('default:tarefa', 'default'));
        $this->add(new Zend_Acl_Resource('default:mensagens', 'default'));

        $this->add(new Zend_Acl_Resource('default:error', 'default'));
        $this->add(new Zend_Acl_Resource('default:index', 'default'));
        $this->add(new Zend_Acl_Resource('default:login', 'default'));
        $this->add(new Zend_Acl_Resource('default:cadastro', 'default'));

        $this->allow(null, 'default');
        $this->allow(null, 'default:cadastro');

        $this->allow(null, 'default:error');
        $this->allow(null, 'default:index');
        $this->allow(null, 'default:login');

        $this->deny('visitante', 'default:preferencias');
        $this->deny('visitante', 'default:projeto');
        $this->deny('visitante', 'default:money');

        $this->allow('cliente', 'default:projeto');
        $this->allow('cliente', 'default:tarefa');
        $this->allow('cliente', 'default:mensagens');
        $this->allow('cliente', 'default:money');
		
        $this->allow('cliente', 'default:preferencias');
		
    }

}

?>